//
//  NCSinglePictureViewer.h
//  BaiduTravel
//
//  Created by bilinguis on 12-2-2.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//


#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import "NCBTImage.h"
#import "RCBaseVC.h"

@protocol NCSinglePictureViewerDelegate <NSObject>

@optional
-(void) pictureZoomBegan;
-(void) pictureZoomEnded;

@end

@class NCPictureViewerBar;
@class NCNaviReturnButton;
@interface NCSinglePictureViewer : RCBaseVC <UIScrollViewDelegate> {
    
    UIImageView *_watingImageView;
    
    // Not own
    UIScrollView *_imageScrollView;
    
    //Not own
    UIButton *_backgroundButton;
    
    // Not own
	NCBTImage *_imageView;
    
    
    float    _imageMinWidth;
    
    CGRect   _maxImageRect;
    
    // the downloading pic size.
    CGSize _originSize;
    
    // hold the image url.
    NSString *_pic_id;
    NSString *_picUrl;
    NSString *_pic_title;
    NSString *_pic_location;
    BOOL    saveStateEnable;
    
//    UIView *container;

}

@property (nonatomic, retain)  UIScrollView *imageScrollView;
@property (nonatomic, retain)  NCBTImage    *imageView;
//@property (nonatomic, readonly)  CGSize originSize;
@property (nonatomic, retain)  NSString     *picUrl;
@property (nonatomic, assign)     BOOL      saveStateEnable;
@property (nonatomic, assign)     float     fScreenHeight;
@property (nonatomic, assign)     CGRect    scrollViewFrame;
@property (nonatomic, retain) NSString      *pic_id, *pic_title, *pic_location;
@property (nonatomic, assign) id<NCSinglePictureViewerDelegate> touchDelegate;
@property (nonatomic, retain) UIImage *waitingImage;

- (id) initWithUrl:(NSString *)url AndPicID:(NSString*)PID Title:(NSString *)title Location:(NSString *)location;
- (void)saveButtonClicked;
-(void) addPicTitle:(NSString*)picTitle andPicLocation:(NSString*)location ToViewBottom:(UIView*)target;
-(UIView *) addPicTitleWithStartFrame:(NSString*)picTitle andPicLocation:(NSString*)location startFrame:(CGRect)startFrame;
-(void) setPicTitleAndLocation:(UIView *)titleView andTitle:(NSString *)title andPicLocation:(NSString *)location;
+ (CGFloat) calculateTextHeight:(UILabel*)textField;
//- (void) hidePicInfoBarAnimated:(BOOL)animated;
//- (void) showPicInfoBarAnimated:(BOOL)animated;
@end


@interface NCSinglePictureViewerFullScreen : NCSinglePictureViewer

@end
